/**
 * 
 */
package com.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.demo.bean.User;
import com.demo.dao.AppDAO;
import com.demo.service.AppService;

/**
 * @author Issac
 *
 */
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor={Exception.class}) 
public class AppServiceImpl implements AppService {
	
	@Autowired
	private AppDAO appDAO;
	
	public AppDAO getAppDAO() {
		return appDAO;
	}
	

	public void setAppDAO(AppDAO appDAO) {
		this.appDAO = appDAO;
	}


	public int add(User user) {
		appDAO.add(user);
		return 0;
	}
	
	public User get(String user) {
		User us = appDAO.get(user);
		return us;
	}

	public List<User> list() {
		return appDAO.list();
	}


	public void init(){}
	public void destroy(){}
}
